package standard.util;

/**
 * Create by Lingo
 */

public enum  NullAnnotationEnum {
//import org.hibernate.validator.constraints.NotBlank;
    NOTNULL(0,"NotNull","javax.validation.constraints.NotNull"),
    NOTBLANK(1,"NotBlank","org.hibernate.validator.constraints.NotBlank"),
    NOTEMPTY(2,"NotEmpty","org.hibernate.validator.constraints.NotEmpty");

    private final int code;
    private final String annotation;
    private final String packageName;

    NullAnnotationEnum(int code, String annotation, String packageName) {
        this.code = code;
        this.annotation = annotation;
        this.packageName = packageName;
    }

    public static String getPackageNameByCode(String annotation) {
        for (NullAnnotationEnum value : NullAnnotationEnum.values()) {
            if (value.annotation.equals(annotation)){
                return value.packageName;
            }
        }
        return null;
    }
}
